package com.linzm.biz.log;

import com.linzm.annotation.Around;
import com.linzm.annotation.Aspect;
import com.linzm.annotation.Component;
import com.linzm.annotation.Pointcut;
import com.linzm.aspect.AbstractAspect;
import com.linzm.aspect.IJoinPoint;

/**
 * @Date: 2023/11/9 19:22
 * @User linziming
 */
@Aspect
@Component
public class LogAspect extends AbstractAspect {
    @Pointcut("com.linzm.biz.log.*")
    private void myPointcut() {

    }

    @Around(value = "myPointcut()")
    public Object around(IJoinPoint joinPoint) {
        Long start = System.currentTimeMillis();
        System.out.println("环绕通知start....");
        Object obj = joinPoint.proceed();
        System.out.println("环绕通知end....");
        Long end = System.currentTimeMillis();
        System.out.println("执行方法耗时：" + (end - start));
        return obj;
    }
}
